package com.zzy.study.io;

import java.io.ByteArrayOutputStream;
import java.io.IOException;

public class TestByteArrayOutputStream {
	
	public static void main(String[] args) throws IOException {
		byte[] buffer = "this is a test".getBytes();
		ByteArrayOutputStream out = new ByteArrayOutputStream();
		ByteArrayOutputStream out2 = new ByteArrayOutputStream();
		out.write(90);
		out.write(86);
		out.write(buffer, 0, 6);
		out.writeTo(out2);
		System.out.println(out2);
	}
	
}
